import Api from "../../request/api"
export default {
    namespaced: true,
    state: {
        memberlist: [],
        membertotal: 0
    },
    mutations: {
        initMemberList(state, payload) {
            state.memberlist = payload
        },
        initMemberTotal(state, payload) {
            state.membertotal = payload
        }
    },
    actions: {
        getmemberlist({
            commit
        }, payload) {
            Api.memberlist(payload).then(res => {
                if (res.code == 200) {
                    commit("initMemberList", res.list)
                }
            })
        },
        // 总页数
        getmembertotal({
            commit
        }) {
            Api.membercount().then(res => {
                if (res.code == 200) {
                    commit("initMemberTotal", res.list[0].total)
                }
            })
        }
    },
    getters: {},

}